package com.mitac.mcd.cs.mobiletracking.socketserver;

import java.io.IOException;


public class test
{
    public static void main(String args[]) throws InterruptedException{
        
        String[] servers = { "10.82.36.110:11211" };
        
        /**

         * 建立MemcachedClient实例

         * */
        
        /*MemcachedClient memCachedClient = null;
		try {
			memCachedClient = new MemcachedClient(AddrUtil.getAddresses("127.0.0.1:11211"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
        //Thread.sleep(20*1000);
        //memCachedClient.flushAll();
        /*for (int i = 0; i < 1000; i++) {
            
            //将对象加入到memcached缓存
            String [] array = new String[i];
            for (int k=0;k<i;k++){
                array[k] = "Hello!";
            }
            boolean success = memCachedClient.set("" + i, array);
            System.out.println(String.format("set( %d ): %s", i, success));
            
        }*/
        
        /*memCachedClient.set("1", 0, "aaa");
        System.out.println(memCachedClient.get("1"));
        long unique1 = memCachedClient.gets("1").getCas();
        System.out.println(unique1);
        memCachedClient.set("1", 0, "bbb");
        System.out.println(memCachedClient.get("1"));
        long unique2 = memCachedClient.gets("1").getCas();
        System.out.println(unique2);
        CASResponse flag = memCachedClient.cas("1", unique1, "ccc");
        System.out.println(flag.toString());
        System.out.println(memCachedClient.get("1"))*/;
        /*while(true){
        	try{
        	memCachedClient.set("1", 0, "test");
        	}catch(Exception e){
        		e.printStackTrace();
        		System.out.println("add failed...");
        	}
        	System.out.println("add successfully...");
        	Thread.sleep(5*1000);
        }*/
        
        
    }
}
